<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>发现精彩 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --secondary: #6366f1;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --ad-label: #ff6b35;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f1f5f9;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            text-align: center;
            flex: 1;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
        }
        
        /* 搜索栏 */
        .search-bar {
            padding: 12px 16px;
            background-color: var(--bg-white);
        }
        
        .search-form {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 14px;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
            font-size: 16px;
        }
        
        /* 分类筛选 */
        .category-filter {
            padding: 0 16px;
            background-color: var(--bg-white);
            overflow-x: auto;
            white-space: nowrap;
        }
        
        .category-list {
            display: flex;
            gap: 16px;
            padding: 12px 0;
        }
        
        .category-item {
            padding: 6px 14px;
            border-radius: 18px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            background-color: var(--bg-light);
            white-space: nowrap;
        }
        
        .category-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 广告列表容器 */
        .ad-list {
            padding: 12px 16px 20px;
        }
        
        /* 广告通用样式 */
        .ad-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin-bottom: 16px;
            overflow: hidden;
            box-shadow: var(--shadow);
        }
        
        .ad-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .ad-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            background-color: var(--primary);
        }
        
        .ad-meta {
            flex: 1;
        }
        
        .ad-title {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .ad-label {
            font-size: 10px;
            padding: 1px 6px;
            border-radius: 4px;
            background-color: var(--ad-label);
            color: white;
            font-weight: 500;
        }
        
        .ad-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        
        .ad-content {
            padding: 0 16px 12px;
        }
        
        .ad-description {
            font-size: 15px;
            line-height: 1.5;
            margin-bottom: 12px;
        }
        
        /* 图片布局 - 多图样式 */
        .ad-images-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            margin-bottom: 12px;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .ad-image {
            aspect-ratio: 1/1;
            overflow: hidden;
            position: relative;
        }
        
        .ad-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        /* 图片布局 - 大图样式 */
        .ad-image-large {
            width: 100%;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .ad-image-large img {
            width: 100%;
            display: block;
        }
        
        /* 无图广告样式 */
        .ad-no-image {
            padding-bottom: 12px;
        }
        
        /* 广告标签 */
        .ad-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .ad-tag {
            font-size: 13px;
            padding: 3px 10px;
            border-radius: 12px;
            background-color: var(--bg-light);
            color: var(--text-secondary);
        }
        
        /* 广告互动区 */
        .ad-actions {
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: space-around;
        }
        
        .ad-action {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: var(--text-secondary);
            padding: 4px 0;
        }
        
        /* 特殊样式广告 */
        .ad-featured {
            border: 1px solid var(--primary);
        }
        
        .ad-featured .ad-header {
            background-color: rgba(59, 130, 246, 0.05);
        }
        
        .ad-banner {
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 16px;
            position: relative;
        }
        
        .ad-banner img {
            width: 100%;
            display: block;
        }
        
        .banner-label {
            position: absolute;
            top: 10px;
            left: 10px;
            font-size: 12px;
            padding: 2px 8px;
            border-radius: 4px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 20px;
        }
        
        /* 图片预览弹窗 */
        .image-preview-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.9);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }
        
        .image-preview-modal.active {
            display: flex;
        }
        
        .preview-image {
            max-width: 90%;
            max-height: 80%;
            object-fit: contain;
        }
        
        .close-preview {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">发现精彩</div>
        <button class="nav-btn" id="menuBtn">
            <i class="fas fa-cog"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-bar">
        <form class="search-form">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索感兴趣的内容...">
        </form>
    </div>
    
    <!-- 分类筛选 -->
    <div class="category-filter">
        <div class="category-list">
            <div class="category-item active">全部</div>
            <div class="category-item">精选推荐</div>
            <div class="category-item">数码科技</div>
            <div class="category-item">生活服务</div>
            <div class="category-item">美食餐饮</div>
            <div class="category-item">旅游出行</div>
            <div class="category-item">教育培训</div>
        </div>
    </div>
    
    <!-- 广告列表 -->
    <div class="ad-list">
        <!-- 横幅广告 -->
        <div class="ad-banner" data-type="banner">
            <img src="https://picsum.photos/id/237/600/200" alt="夏季促销活动">
            <span class="banner-label">推广</span>
        </div>
        
        <!-- 多图广告 -->
        <div class="ad-card" data-type="multi-image">
            <div class="ad-header">
                <img src="https://picsum.photos/id/64/100/100" alt="品牌Logo" class="ad-avatar">
                <div class="ad-meta">
                    <div class="ad-title">
                        夏日新品发布会
                        <span class="ad-label">广告</span>
                    </div>
                    <div class="ad-time">今天 10:30</div>
                </div>
            </div>
            <div class="ad-content">
                <div class="ad-description">
                    2023夏季新品发布会即将开始，多款智能设备惊艳亮相，现场体验更有专属优惠，欢迎预约参加！
                </div>
                <div class="ad-images-grid">
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/1/300/300" alt="产品图片1">
                    </div>
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/2/300/300" alt="产品图片2">
                    </div>
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/3/300/300" alt="产品图片3">
                    </div>
                </div>
                <div class="ad-tags">
                    <span class="ad-tag">新品发布</span>
                    <span class="ad-tag">智能设备</span>
                    <span class="ad-tag">线下活动</span>
                </div>
            </div>
            <div class="ad-actions">
                <div class="ad-action" data-action="like">
                    <i class="far fa-heart"></i>
                    <span>感兴趣</span>
                </div>
                <div class="ad-action" data-action="comment">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </div>
                <div class="ad-action" data-action="share">
                    <i class="far fa-share-square"></i>
                    <span>分享</span>
                </div>
                <div class="ad-action" data-action="more">
                    <i class="fas fa-ellipsis-h"></i>
                </div>
            </div>
        </div>
        
        <!-- 大图广告 -->
        <div class="ad-card ad-featured" data-type="single-image">
            <div class="ad-header">
                <img src="https://picsum.photos/id/65/100/100" alt="品牌Logo" class="ad-avatar">
                <div class="ad-meta">
                    <div class="ad-title">
                        周末美食节
                        <span class="ad-label">精选</span>
                    </div>
                    <div class="ad-time">昨天 18:45</div>
                </div>
            </div>
            <div class="ad-content">
                <div class="ad-description">
                    本周末将举办大型美食节，汇聚全球特色美食，更有厨师现场制作表演，早鸟票限时8折优惠！
                </div>
                <div class="ad-image-large">
                    <img src="https://picsum.photos/id/42/600/300" alt="美食节图片">
                </div>
                <div class="ad-tags">
                    <span class="ad-tag">美食</span>
                    <span class="ad-tag">优惠活动</span>
                    <span class="ad-tag">周末</span>
                </div>
            </div>
            <div class="ad-actions">
                <div class="ad-action" data-action="like">
                    <i class="far fa-heart"></i>
                    <span>感兴趣</span>
                </div>
                <div class="ad-action" data-action="comment">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </div>
                <div class="ad-action" data-action="share">
                    <i class="far fa-share-square"></i>
                    <span>分享</span>
                </div>
                <div class="ad-action" data-action="more">
                    <i class="fas fa-ellipsis-h"></i>
                </div>
            </div>
        </div>
        
        <!-- 无图广告 -->
        <div class="ad-card" data-type="no-image">
            <div class="ad-header">
                <img src="https://picsum.photos/id/66/100/100" alt="品牌Logo" class="ad-avatar">
                <div class="ad-meta">
                    <div class="ad-title">
                        在线课程特惠
                        <span class="ad-label">广告</span>
                    </div>
                    <div class="ad-time">2天前</div>
                </div>
            </div>
            <div class="ad-content ad-no-image">
                <div class="ad-description">
                    年度学习盛宴，100+精品课程限时折扣，新用户注册即送300元学习基金，涵盖编程、设计、商业等多个领域，提升自我从现在开始！
                </div>
                <div class="ad-tags">
                    <span class="ad-tag">在线教育</span>
                    <span class="ad-tag">限时优惠</span>
                    <span class="ad-tag">新用户福利</span>
                </div>
            </div>
            <div class="ad-actions">
                <div class="ad-action" data-action="like">
                    <i class="far fa-heart"></i>
                    <span>感兴趣</span>
                </div>
                <div class="ad-action" data-action="comment">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </div>
                <div class="ad-action" data-action="share">
                    <i class="far fa-share-square"></i>
                    <span>分享</span>
                </div>
                <div class="ad-action" data-action="more">
                    <i class="fas fa-ellipsis-h"></i>
                </div>
            </div>
        </div>
        
        <!-- 多图广告 -->
        <div class="ad-card" data-type="multi-image">
            <div class="ad-header">
                <img src="https://picsum.photos/id/67/100/100" alt="品牌Logo" class="ad-avatar">
                <div class="ad-meta">
                    <div class="ad-title">
                        夏日旅游特惠
                        <span class="ad-label">广告</span>
                    </div>
                    <div class="ad-time">3天前</div>
                </div>
            </div>
            <div class="ad-content">
                <div class="ad-description">
                    暑期旅游季，精选国内外多条热门线路，预订即送旅行大礼包，两人同行一人半价，限时抢购中！
                </div>
                <div class="ad-images-grid">
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/28/300/300" alt="旅游景点1">
                    </div>
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/29/300/300" alt="旅游景点2">
                    </div>
                    <div class="ad-image">
                        <img src="https://picsum.photos/id/30/300/300" alt="旅游景点3">
                    </div>
                </div>
                <div class="ad-tags">
                    <span class="ad-tag">旅游</span>
                    <span class="ad-tag">暑期特惠</span>
                    <span class="ad-tag">亲子游</span>
                </div>
            </div>
            <div class="ad-actions">
                <div class="ad-action" data-action="like">
                    <i class="far fa-heart"></i>
                    <span>感兴趣</span>
                </div>
                <div class="ad-action" data-action="comment">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </div>
                <div class="ad-action" data-action="share">
                    <i class="far fa-share-square"></i>
                    <span>分享</span>
                </div>
                <div class="ad-action" data-action="more">
                    <i class="fas fa-ellipsis-h"></i>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-plus-circle nav-icon"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 图片预览弹窗 -->
    <div class="image-preview-modal" id="imagePreviewModal">
        <img src="" alt="图片预览" class="preview-image" id="previewImage">
        <button class="close-preview" id="closePreview">
            <i class="fas fa-times"></i>
        </button>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const menuBtn = document.getElementById('menuBtn');
        const categoryItems = document.querySelectorAll('.category-item');
        const adActions = document.querySelectorAll('.ad-action');
        const adImages = document.querySelectorAll('.ad-image img, .ad-image-large img, .ad-banner img');
        const imagePreviewModal = document.getElementById('imagePreviewModal');
        const previewImage = document.getElementById('previewImage');
        const closePreview = document.getElementById('closePreview');
        const toast = document.getElementById('toast');
        
        // 显示提示消息
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            clearTimeout(toast.timeout);
            toast.timeout = setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 打开图片预览
        function openImagePreview(src) {
            previewImage.src = src;
            imagePreviewModal.classList.add('active');
            document.body.style.overflow = 'hidden';
        }
        
        // 关闭图片预览
        function closeImagePreview() {
            imagePreviewModal.classList.remove('active');
            document.body.style.overflow = 'auto';
        }
        
        // 绑定事件
        function bindEvents() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                history.back();
                showToast('返回上一页');
            });
            
            // 菜单按钮
            menuBtn.addEventListener('click', () => {
                showToast('打开设置菜单');
            });
            
            // 分类筛选
            categoryItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有active类
                    categoryItems.forEach(i => i.classList.remove('active'));
                    // 添加当前active类
                    this.classList.add('active');
                    showToast(`已选择: ${this.textContent}`);
                });
            });
            
            // 广告操作按钮
            adActions.forEach(action => {
                action.addEventListener('click', function() {
                    const actionType = this.getAttribute('data-action');
                    const actions = {
                        'like': '已添加到感兴趣',
                        'comment': '打开咨询窗口',
                        'share': '分享成功',
                        'more': '更多操作'
                    };
                    
                    // 处理点赞状态切换
                    if (actionType === 'like') {
                        const icon = this.querySelector('i');
                        if (icon.classList.contains('far')) {
                            icon.classList.remove('far');
                            icon.classList.add('fas', 'text-danger');
                        } else {
                            icon.classList.remove('fas', 'text-danger');
                            icon.classList.add('far');
                        }
                    }
                    
                    showToast(actions[actionType] || '操作成功');
                });
            });
            
            // 广告图片点击预览
            adImages.forEach(img => {
                img.addEventListener('click', function() {
                    openImagePreview(this.src);
                });
            });
            
            // 关闭图片预览
            closePreview.addEventListener('click', closeImagePreview);
            
            // 点击预览背景关闭
            imagePreviewModal.addEventListener('click', function(e) {
                if (e.target === this) {
                    closePreview();
                }
            });
        }
        
        // 初始化
        function init() {
            bindEvents();
        }
        
        // 启动
        init();
    </script>
</body>
</html>
